package org.bulu.project.system.service.impl.per;

import org.bulu.project.system.mapper.DynamicMapper;
import org.bulu.project.system.model.entity.Dynamic;
import org.bulu.project.system.model.entity.Video;
import org.bulu.project.system.service.DynamicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;

@Service
public class DynamicServiceImpl implements DynamicService {

    @Autowired
    private  DynamicMapper dynamicMapper;
    @Override
    public List<Dynamic> getVideosByIds(Integer uid) {

        return dynamicMapper.getVideoByIds(uid);
    }

    @Override
    public Dynamic getVideoWithDataById(Integer did) {
        return dynamicMapper.getVideoById(did);
    }

    @Override
    public int addDynamic(Dynamic video) throws IOException {
        return dynamicMapper.insert(video);
    }

    @Override
    public int delDynamic(Integer did) throws IOException {
        return dynamicMapper.deleteById(did);
    }

    @Override
    public int updateDynamic(Dynamic video) throws IOException {
        return dynamicMapper.updateDynamic(video);
    }

    @Override
    public List<Video> getVideosWithDataByIdList(List<Integer> list) {
        return List.of();
    }
}
